package org.huntaway.kindergarten.po.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the ttg table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="ttg"
 */

public abstract class BaseTtg  implements Serializable {

	public static String REF = "Ttg";
	public static String PROP_POST_NAME = "PostName";
	public static String PROP_INTRODUCTION = "Introduction";
	public static String PROP_ID = "Id";
	public static String PROP_REMARK = "Remark";
	public static String PROP_PERSON = "Person";
	public static String PROP_TG = "Tg";


	// constructors
	public BaseTtg () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseTtg (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String postName;
	private java.lang.String remark;
	private java.lang.String introduction;

	// many to one
	private org.huntaway.kindergarten.po.Personinfo person;
	private org.huntaway.kindergarten.po.TeacherGroup tg;

	// collections
	private java.util.Set<org.huntaway.kindergarten.po.ClassInfo> classinfos;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="ttg_id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: post_name
	 */
	public java.lang.String getPostName () {
		return postName;
	}

	/**
	 * Set the value related to the column: post_name
	 * @param postName the post_name value
	 */
	public void setPostName (java.lang.String postName) {
		this.postName = postName;
	}



	/**
	 * Return the value associated with the column: remark
	 */
	public java.lang.String getRemark () {
		return remark;
	}

	/**
	 * Set the value related to the column: remark
	 * @param remark the remark value
	 */
	public void setRemark (java.lang.String remark) {
		this.remark = remark;
	}



	/**
	 * Return the value associated with the column: introduction
	 */
	public java.lang.String getIntroduction () {
		return introduction;
	}

	/**
	 * Set the value related to the column: introduction
	 * @param introduction the introduction value
	 */
	public void setIntroduction (java.lang.String introduction) {
		this.introduction = introduction;
	}



	/**
	 * Return the value associated with the column: person_id
	 */
	public org.huntaway.kindergarten.po.Personinfo getPerson () {
		return person;
	}

	/**
	 * Set the value related to the column: person_id
	 * @param person the person_id value
	 */
	public void setPerson (org.huntaway.kindergarten.po.Personinfo person) {
		this.person = person;
	}



	/**
	 * Return the value associated with the column: tg_id
	 */
	public org.huntaway.kindergarten.po.TeacherGroup getTg () {
		return tg;
	}

	/**
	 * Set the value related to the column: tg_id
	 * @param tg the tg_id value
	 */
	public void setTg (org.huntaway.kindergarten.po.TeacherGroup tg) {
		this.tg = tg;
	}



	/**
	 * Return the value associated with the column: Classinfos
	 */
	public java.util.Set<org.huntaway.kindergarten.po.ClassInfo> getClassinfos () {
		return classinfos;
	}

	/**
	 * Set the value related to the column: Classinfos
	 * @param classinfos the Classinfos value
	 */
	public void setClassinfos (java.util.Set<org.huntaway.kindergarten.po.ClassInfo> classinfos) {
		this.classinfos = classinfos;
	}

	public void addToClassinfos (org.huntaway.kindergarten.po.ClassInfo classInfo) {
		if (null == getClassinfos()) setClassinfos(new java.util.TreeSet<org.huntaway.kindergarten.po.ClassInfo>());
		getClassinfos().add(classInfo);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof org.huntaway.kindergarten.po.Ttg)) return false;
		else {
			org.huntaway.kindergarten.po.Ttg ttg = (org.huntaway.kindergarten.po.Ttg) obj;
			if (null == this.getId() || null == ttg.getId()) return false;
			else return (this.getId().equals(ttg.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}